<script>
//    var router_url = "<?php echo Router::url(array('controller'=>'','action'=>''));?>";
//    
//    function routerUrl(controller, action, parameters)
//    {
//        full_url = "http://localhost"+router_url+"/"+controller+"/"+action+"/"+parameters;
//        return full_url;
//    }
//    
//    function abrePagina(url)
//    {
//        $.ajax({
//            cache: false,
//            type: 'GET',
//            dataType: 'HTML', 
//            url: url,
//            data: { name: "John", location: "Boston" }
//            }).done(function( msg ) {
//                $('.alvo').html(msg);
//        });
//    }
//
//    $(document).ready(function(){
//        abrePagina(routerUrl('pages','edit',1));
//    });

</script>

<section id="typography">
  <div class="page-header">
    <h1>Gerenciador <small>páginas, fotos, vídeos, agenda e o conteúdo que precisar</small></h1>
  </div>
    
    
    <?php echo $this->element('_admin/management_menu'); ?>

  <!-- Headings & Paragraph Copy -->
    <div class="row">
        <div class="span12">
        <h2>Galeria de Fotos</h2>
        <?php echo $this->element('_admin/flash_messages'); ?>
 
       
        
<!--        <ul class="nav nav-pills">
            <li class="active"><a href="#tiles">Todas as fotos</a></li>
            <li class=""><a href="#tiles">Festas</a></li>
            <li class=""><a href="#tiles">Clientes</a></li>
            <li class=""><a href="#tiles">Fotos do Facebook</a></li>
            <li class=""><a href="#tiles">Instagram</a></li>
        </ul>
        
        -->
        <ul class="thumbnails">
            
            <? foreach($Photos as $Photo)
            {
                ?>
                <li class="span3">
                    <?
                    
                    echo $this->Html->link(  
                        $this->Html->image('../'.$Photo['Image']['dir'].'/'.$Photo['Image']['filename']),
                            array('action'=>'edit',$Photo['Photo']['id']),
                            array('escape'=>false, 'class'=>'thumbnail')
                      );
                    
                    
                   
                    ?>
                </li>
                <?
            }
            ?>
          
          
          <li class="span3">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/260x180" alt="">
            </a>
          </li>
        </ul>
      </div>
    </div>
</section>